package day18;
import java.util.*;

public class TestCollections {
    public static void main(String[] args){
        ArrayList<Integer> list = new ArrayList<>();
        Collections.addAll(list, 19,23,57,23,8,1,6,8);
        Object[] data = list.toArray();
//        System.out.println(list);

        for(int i = 0; i < data.length; i++){
            Object min = data[i];
            for(int j = i; j < data.length; j++){
                if((int)(min) > (int)(data[j])){
                    min = data[j];
                    data[j] = data[i];
                    data[i] = min;
                }
            }
        }

        for(Object x : data){ System.out.print(x +  " ");}

    }
}
